<template>
  <div class="camping">
    <div class="navsearch">
      <Navsearch></Navsearch>
      <hr />
    </div>

    <div class="camping-all">
      <div class="camping-all-1"><h3>帐篷露营</h3></div>
      <div>
        <van-tabs v-model="active" color="#00be88">
          <van-tab title="精选营地" class="camping-all-2">
            <a class="camping-all-2-a" @click="$router.push('/coach')">
              <img src="../../assets/img/chunyou_01.jpg" alt="" />
              <div class="d1">
                【春日露营&amp;牡丹节限定】上海金山廊下湖畔营地套票（赠牡丹节门票
                围炉煮茶/烧烤/火锅可选
                盲盒套圈\飞盘\野营大飞行棋\羽毛球等玩乐可选
                可带宠物/露营聚会/团建轰趴/闺蜜聚餐/生日派对）
              </div>
              <div class="d2">
                <span class="s1">￥50起</span>
                <span class="s2">上海</span>
              </div>
            </a>
          </van-tab>
          <van-tab title="金山农民画村"></van-tab>
          <van-tab title="金山廊下"></van-tab>
          <van-tab title="奉贤海湾"></van-tab>
        </van-tabs>
      </div>
    </div>
    <div class="else">
      <div class="e1"><h3>其他</h3></div>
      <div class="e2">查看全部产品></div>
    </div>
    <div class="city">
      <div class="city-all"><h3>热门城市</h3></div>
      <van-swipe @change="onChange" width="150">
        <van-swipe-item>
          <img src="../../assets/img/city_0.png" class="map" />
        </van-swipe-item>
        <van-swipe-item
          ><img src="../../assets/img/city_1.png" class="map"
        /></van-swipe-item>
        <van-swipe-item
          ><img src="../../assets/img/city_2.png" class="map"
        /></van-swipe-item>
        <van-swipe-item
          ><img src="../../assets/img/city_3.png" class="map"
        /></van-swipe-item>
        <van-swipe-item
          ><img src="../../assets/img/city_03.png" class="map"
        /></van-swipe-item>
        <template #indicator>
          <div class="custom-indicator">{{ current + 1 }}/5</div>
        </template>
      </van-swipe>
    </div>
  </div>
</template>

<script>
import Navsearch from "@/components/contern/navsearch.vue";
export default {
  data() {
    return {
      current: 0,
      active:''
    };
  },
  methods: {
    onChange(index) {
      this.current = index;
    },
  },
  name: "camping",
  components: {
    Navsearch,
  },
};
</script>

<style lang="scss" scoped>
.camping {
  position: fixed;
  .city {
    margin: 5px 10px 0 10px;
    .map {
      width: 100px;
    }
    .custom-indicator {
      position: absolute;
      right: 5px;
      bottom: 5px;
      padding: 2px 5px;
      font-size: 12px;
      background: rgba(0, 0, 0, 0.1);
    }
    .city-all {
      margin-bottom: 8px;
    }
  }
  .else {
    display: flex;
    justify-content: space-between;
    padding: 14px;
    margin: 10px 0 10px 0;
    background-color: #fff;

    .e2 {
      color: #999;
      font-size: 12px;
    }
  }
  .navsearch {
    margin-bottom: 50px;
  }
  .camping-all {
    background-color: #fff;
    .camping-all-1 {
      margin: 0 0 5px 15px;
      font-size: 13px;
      position: relative;
      top: 5px;
    }
    .camping-all-2 {
      margin-left: 10px;

      .camping-all-2-a {
        display: block;
        width: 145px;
        img {
          margin-top: 10px;
          height: 110px;
          width: 100%;
          object-fit: contain;
        }
        .d1 {
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
        }
        .d2 {
          display: flex;
          justify-content: space-between;
          padding: 10px 10px 8px 0px;

          .s1 {
            color: red;
            font-size: 20px;
          }
          .s2 {
            color: #999;
            position: relative;
            top: 5px;
          }
        }
      }
    }
  }
}
</style>
